home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / numtow_1 / convertd.frm next >
Text File  |  1998-09-08  |  5KB  |  179 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   3195
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   5685
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   3195
  10.    ScaleWidth      =   5685
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.Frame frameCase 
  13.       Caption         =   "Case"
  14.       Height          =   1215
  15.       Left            =   120
  16.       TabIndex        =   10
  17.       Top             =   720
  18.       Width           =   1815
  19.       Begin VB.OptionButton OptCase 
  20.          Caption         =   "lower case"
  21.          Height          =   195
  22.          Index           =   2
  23.          Left            =   240
  24.          TabIndex        =   13
  25.          Top             =   840
  26.          Width           =   1335
  27.       End
  28.       Begin VB.OptionButton OptCase 
  29.          Caption         =   "Title Case"
  30.          Height          =   195
  31.          Index           =   0
  32.          Left            =   240
  33.          TabIndex        =   12
  34.          Top             =   360
  35.          Value           =   -1  'True
  36.          Width           =   1215
  37.       End
  38.       Begin VB.OptionButton OptCase 
  39.          Caption         =   "UPPER CASE"
  40.          Height          =   195
  41.          Index           =   1
  42.          Left            =   240
  43.          TabIndex        =   11
  44.          Top             =   600
  45.          Width           =   1455
  46.       End
  47.    End
  48.    Begin VB.TextBox txtUnit 
  49.       Enabled         =   0   'False
  50.       Height          =   285
  51.       Left            =   4080
  52.       TabIndex        =   8
  53.       Text            =   "Cent"
  54.       Top             =   1080
  55.       Width           =   1455
  56.    End
  57.    Begin VB.TextBox txtCurrencyType 
  58.       Enabled         =   0   'False
  59.       Height          =   285
  60.       Left            =   2520
  61.       TabIndex        =   6
  62.       Text            =   "Dollar"
  63.       Top             =   1080
  64.       Width           =   1455
  65.    End
  66.    Begin VB.CheckBox chkUseCurrency 
  67.       Caption         =   "Use Currency"
  68.       Height          =   255
  69.       Left            =   2520
  70.       TabIndex        =   5
  71.       Top             =   360
  72.       Width           =   1815
  73.    End
  74.    Begin VB.TextBox txtWords 
  75.       Height          =   285
  76.       Left            =   0
  77.       TabIndex        =   3
  78.       Top             =   2280
  79.       Width           =   5535
  80.    End
  81.    Begin VB.TextBox txtNumber 
  82.       Height          =   285
  83.       Left            =   120
  84.       TabIndex        =   1
  85.       Text            =   "100.15"
  86.       Top             =   360
  87.       Width           =   1815
  88.    End
  89.    Begin VB.CommandButton cmdConvert 
  90.       Caption         =   "Convert to Words"
  91.       Height          =   495
  92.       Left            =   3360
  93.       TabIndex        =   0
  94.       Top             =   2640
  95.       Width           =   2175
  96.    End
  97.    Begin VB.Label Label4 
  98.       Caption         =   "Unit"
  99.       Height          =   255
  100.       Left            =   4080
  101.       TabIndex        =   9
  102.       Top             =   720
  103.       Width           =   1095
  104.    End
  105.    Begin VB.Label Label3 
  106.       Caption         =   "Currency"
  107.       Height          =   255
  108.       Left            =   2520
  109.       TabIndex        =   7
  110.       Top             =   720
  111.       Width           =   1095
  112.    End
  113.    Begin VB.Label Label2 
  114.       Caption         =   "Words:"
  115.       Height          =   255
  116.       Left            =   0
  117.       TabIndex        =   4
  118.       Top             =   2040
  119.       Width           =   1215
  120.    End
  121.    Begin VB.Label Label1 
  122.       Caption         =   "Number:"
  123.       Height          =   255
  124.       Left            =   120
  125.       TabIndex        =   2
  126.       Top             =   120
  127.       Width           =   1215
  128.    End
  129. End
  130. Attribute VB_Name = "Form1"
  131. Attribute VB_GlobalNameSpace = False
  132. Attribute VB_Creatable = False
  133. Attribute VB_PredeclaredId = True
  134. Attribute VB_Exposed = False
  135. Option Explicit
  136. Private Sub chkUseCurrency_Click()
  137. If chkUseCurrency.Value = Checked Then
  138.     txtCurrencyType.Enabled = True
  139.     txtUnit.Enabled = True
  140. Else
  141.     txtCurrencyType.Enabled = False
  142.     txtUnit.Enabled = False
  143. End If
  144. End Sub
  145.  
  146. Private Sub cmdConvert_Click()
  147. 'Create an new instance of the dll
  148. Dim obj As New ConvertNum.NumtoText
  149. Dim m_UseCurrency As Boolean
  150. Dim m_CurrencyType As String
  151. Dim m_CurrencyUnit As String
  152. Dim m_Value As String
  153. Dim sCase As String
  154.  
  155. If chkUseCurrency.Value = Checked Then
  156.     m_UseCurrency = True
  157.     m_CurrencyType = txtCurrencyType.Text
  158.     m_CurrencyUnit = txtUnit.Text
  159. Else
  160.     m_UseCurrency = False
  161.     m_CurrencyType = ""
  162.     m_CurrencyUnit = ""
  163. End If
  164.  
  165. If OptCase(0).Value = True Then sCase = "Title"
  166. If OptCase(1).Value = True Then sCase = "Upper"
  167. If OptCase(2).Value = True Then sCase = "Lower"
  168.  
  169. m_Value = txtNumber.Text
  170.  
  171. 'Call procedure and convert
  172. txtWords.Text = obj.fchange(m_Value, sCase, m_UseCurrency, m_CurrencyType, m_CurrencyUnit)
  173. End Sub
  174.  
  175. Private Sub Form_Resize()
  176. txtWords.Width = Form1.Width - 200
  177. cmdConvert.Left = Form1.Width - (cmdConvert.Width + 200)
  178. End Sub
  179.